package org.jeecg.modules.charge.entity.BwInvoiceEntity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.jeecg.common.util.DateUtils;
import org.jeecg.common.util.StringUtils;
import org.springframework.stereotype.Component;

/**
 * 开票
  @author: Litao
  @date：      日期：2018年9月10日 
  @time:   时间：下午5:53:28
 */
@Component
public class BlueInvoice implements Serializable{
	private static final long serialVersionUID =1L;
	//请求开票地址
	private String url;
	private String xsf_nsrsbh;
	private String xsf_dzdh;
	private String xsf_mc;
	private String xsf_yhzh;
	private String  e_mails;
	//多个电话用逗号隔开 1,2,3
	private String tel;
	//回调URL
	private String buildUrl;
	//发票appid
	private String appid;
	//证书密码
	private String password;
	//证书地址
	private String cert_url;
	//请求流水号
	private String fpqqlsh= StringUtils.getRandomStringByLength(4)+ DateUtils.detailStr(new Date());
	private String comid;
	private String orgcode;
	private String fphm;
	private String fpdm;
	private String gmf_nsrsbh;
	private String gmf_mc;
	private String gmf_dzdh;
	private String gmf_yhzh;
	private String kpr;
	private String skr;
	private String fhr;
	private String yfp_dm;
	private String yfp_hm;
	private Double jshj;
	private String wx_order_id;
	private String wx_app_id;
	private String bz;
	private List<BlueInvoiceDetailed> details=new ArrayList<BlueInvoiceDetailed>();
	
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getXsf_nsrsbh() {
		return xsf_nsrsbh;
	}
	public void setXsf_nsrsbh(String xsf_nsrsbh) {
		this.xsf_nsrsbh = xsf_nsrsbh;
	}
	public String getXsf_dzdh() {
		return xsf_dzdh;
	}	
	public String getFphm() {
		return fphm;
	}
	public void setFphm(String fphm) {
		this.fphm = fphm;
	}
	public String getFpdm() {
		return fpdm;
	}
	public void setFpdm(String fpdm) {
		this.fpdm = fpdm;
	}
	public void setXsf_dzdh(String xsf_dzdh) {
		this.xsf_dzdh = xsf_dzdh;
	}
	public String getXsf_mc() {
		return xsf_mc;
	}
	public void setXsf_mc(String xsf_mc) {
		this.xsf_mc = xsf_mc;
	}
	public String getXsf_yhzh() {
		return xsf_yhzh;
	}
	public void setXsf_yhzh(String xsf_yhzh) {
		this.xsf_yhzh = xsf_yhzh;
	}
	public String getE_mails() {
		return e_mails;
	}
	public void setE_mails(String e_mails) {
		this.e_mails = e_mails;
	}
	public String getTel() {
		return tel;
	}
	public void setTel(String tel) {
		this.tel = tel;
	}
	public String getBuildUrl() {
		return buildUrl;
	}
	public void setBuildUrl(String buildUrl) {
		this.buildUrl = buildUrl;
	}
	public String getAppid() {
		return appid;
	}
	public void setAppid(String appid) {
		this.appid = appid;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getCert_url() {
		return cert_url;
	}
	public void setCert_url(String cert_url) {
		this.cert_url = cert_url;
	}
	public String getFpqqlsh() {
		return fpqqlsh;
	}
	public void setFpqqlsh(String fpqqlsh) {
		this.fpqqlsh = fpqqlsh;
	}
	public String getComid() {
		return comid;
	}
	public void setComid(String comid) {
		this.comid = comid;
	}
	public String getOrgcode() {
		return orgcode;
	}
	public void setOrgcode(String orgcode) {
		this.orgcode = orgcode;
	}
	public String getGmf_nsrsbh() {
		return gmf_nsrsbh;
	}
	public void setGmf_nsrsbh(String gmf_nsrsbh) {
		this.gmf_nsrsbh = gmf_nsrsbh;
	}
	public String getGmf_mc() {
		return gmf_mc;
	}
	public void setGmf_mc(String gmf_mc) {
		this.gmf_mc = gmf_mc;
	}
	public String getGmf_dzdh() {
		return gmf_dzdh;
	}
	public void setGmf_dzdh(String gmf_dzdh) {
		this.gmf_dzdh = gmf_dzdh;
	}
	public String getGmf_yhzh() {
		return gmf_yhzh;
	}
	public void setGmf_yhzh(String gmf_yhzh) {
		this.gmf_yhzh = gmf_yhzh;
	}
	public String getKpr() {
		return kpr;
	}
	public void setKpr(String kpr) {
		this.kpr = kpr;
	}
	public String getSkr() {
		return skr;
	}
	public void setSkr(String skr) {
		this.skr = skr;
	}
	public String getFhr() {
		return fhr;
	}
	public void setFhr(String fhr) {
		this.fhr = fhr;
	}
	public String getYfp_dm() {
		return yfp_dm;
	}
	public void setYfp_dm(String yfp_dm) {
		this.yfp_dm = yfp_dm;
	}
	public String getYfp_hm() {
		return yfp_hm;
	}
	public void setYfp_hm(String yfp_hm) {
		this.yfp_hm = yfp_hm;
	}
	public Double getJshj() {
		return jshj;
	}
	public void setJshj(Double jshj) {
		this.jshj = jshj;
	}
	public String getWx_order_id() {
		return wx_order_id;
	}
	public void setWx_order_id(String wx_order_id) {
		this.wx_order_id = wx_order_id;
	}
	public String getWx_app_id() {
		return wx_app_id;
	}
	public void setWx_app_id(String wx_app_id) {
		this.wx_app_id = wx_app_id;
	}
	public List<BlueInvoiceDetailed> getDetails() {
		return details;
	}
	public void setDetails(List<BlueInvoiceDetailed> details) {
		this.details = details;
	}
	public String getBz() {
		return bz;
	}
	public void setBz(String bz) {
		this.bz = bz;
	}

	/*//初始化对象，根据当前公司ID拿到发票配置
	public BlueInvoice(String comid) {
		super();		
		ApplicationContext ctx = new ClassPathXmlApplicationContext("spring-context.xml"); 
		JdbcTemplate jdbcTemplate1=(JdbcTemplate)ctx.getBean("jdbcTemplate");
		//根据公司ID,拿到对应的公司配置
		String sql="select appid,password  from charge_invoice_config where comid='"+comid+"'";
		List<BlueInvoiceConfig >bics=jdbcTemplate1.query(sql, new BeanPropertyRowMapper<BlueInvoiceConfig>(BlueInvoiceConfig.class));
		if(null==bics ||bics.size()==0) {
			return ;
		}
		BlueInvoiceConfig bic=bics.get(0);
		this.xsf_nsrsbh=bic.getXsf_nsrsbh();
		this.appid=bic.getAppid();
		this.xsf_dzdh=bic.getXsf_dzdh();
		this.xsf_mc=bic.getXsf_mc();
		this.xsf_yhzh=bic.getXsf_yhzh();
		this.password=bic.getPassword();
		this.cert_url=bic.getCert_url();
	}*/
	

	
	}
